home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Tools 5
/
Amiga Tools 5.iso
/
tools
/
system-tools
/
hdenv
/
install-hdenv.rexx
< prev
next >
Wrap
OS/2 REXX Batch file
|
1996-04-10
|
3KB
|
73 lines
/*****************************************************************************\
$VER: Install-HDEnv.rexx 1.0 (10.4.96)
Copyright (C) 1996 by Michael Fedrowitz
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
\*****************************************************************************/
Signal ON IOErr
makedir = 0
assign = 0
hdenv = 0
IF Open('in','S:Startup-sequence','Read') THEN DO
IF Open('out','T:Startup-sequence','Write') THEN DO
IF Arg(1,'Exists') THEN dir = Arg(1)
ELSE dir = 'SYS:Env'
DO WHILE ~EOF('in')
line = ReadLn('in')
IF (Pos('MAKEDIR',Upper(line)) ~== 0) THEN DO
n = Find(Upper(line),'RAM:ENV')
IF (n ~== 0) THEN DO
makedir = 1
line = DelWord(line,n,1)
n = Find(Upper(line),'RAM:ENV/SYS')
IF (n ~== 0) THEN line = DelWord(line,n,1)
line = Trim(line)
END
END
IF (Pos('ASSIGN',Upper(line)) ~== 0 & makedir & ~assign) THEN DO
n = Find(Upper(line),'ENV:')
IF (n ~== 0) THEN DO
assign = 1
s = SubWord(line,n+2)
line = DelWord(line,n+1)
line = Trim(line) || ' ' || dir || ' ' || s
line = Trim(line)
END
END
IF (Pos('COPY',Upper(line)) == 0 | Pos('ENV',Upper(line)) == 0) THEN WriteLn('out',line)
IF (Pos('ASSIGN',Upper(line)) == 0 & assign & ~hdenv) THEN DO
hdenv = 1
WriteLn('out','HDEnv')
WriteLn('out','')
END
END
END
END
IOErr:
Close('in')
Close('out')
IF (~hdenv & Exists('T:Startup-sequence')) THEN Address COMMAND 'Delete >NIL: T:Startup-sequence'